package com.geetour.columbus.region.bo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.geetour.columbus.common.exceptions.BOException;
import com.geetour.columbus.common.model.R.AreaPage;
import com.geetour.columbus.region.bo.IAreaPageBO;
import com.geetour.columbus.region.dao.IAreaPageDAO;

@Service
public class AreaPageBOImpl implements IAreaPageBO {

    private IAreaPageDAO areaPageDAOImpl;

    @Autowired
    public void setAreaPageDAOImpl(IAreaPageDAO areaPageDAOImpl) {
        this.areaPageDAOImpl = areaPageDAOImpl;
    }

    @Override
    public void insertAreaPage(AreaPage area) throws BOException {
        if (area == null) {
            return;
        }
        areaPageDAOImpl.insertAreaPage(area);
    }

    @Override
    public int insertAreaPageBatch(List<AreaPage> areaList) throws BOException {
        if (areaList == null || areaList.isEmpty()) {
            return -1;
        }
        return areaPageDAOImpl.insertAreaPageBatch(areaList);
    }

    @Override
    public int updateAreaPage(AreaPage area) throws BOException {
        if (area == null) {
            return -1;
        }
        return areaPageDAOImpl.updateAreaPage(area);
    }

    @Override
    public int deleteAreaPageById(Long id) throws BOException {
        if (id == null) {
            return -1;
        }
        return areaPageDAOImpl.deleteAreaPageById(id);
    }

    @Override
    public AreaPage findAreaPageById(Long id) throws BOException {
        if (id == null) {
            return null;
        }
        return areaPageDAOImpl.findAreaPageById(id);
    }

    @Override
    public List<AreaPage> findAllAreaPages() throws BOException {
        return areaPageDAOImpl.findAllAreaPages();
    }

    @Override
    public List<AreaPage> findAreaPages(AreaPage area) throws BOException {
        if (area == null) {
            return null;
        }
        return areaPageDAOImpl.findAreaPages(area);
    }

}
